#ifndef     __PICK_DOOR_H
#define     __PICK_DOOR_H

#include "../../utils/nocopyable.h"
#include "../../utils/object.h"
#include "../../utils/error.h"

namespace driver {

class PickDoor : private utils::NoCopyable {

public:
    enum class Dir : uint8_t {
        OPEN = 0,
        CLOSE = 1,
        BRAKE = 3,

        STRAW_OPEN = CLOSE,
        STRAW_CLOSE = OPEN,
    };

    static constexpr uint32_t TIMEOUT_DURATION = 12 * 1000;
    static constexpr uint32_t LOCK_MAX_COUNT = 10;
    static constexpr uint32_t LOCK_DELAY = 500;

    PickDoor();

    static utils::Error open1();
    static utils::Error close1();
    
    static utils::Error open2();
    static utils::Error close2();

    static utils::Error open_straw();
    static utils::Error close_straw();

private:
    static void set_dir(Dir dir);
};

inline utils::Object<PickDoor> pickDoor;

}



#endif
